function pack(nameinput,pwdinput){
    var id=nameinput;
    var pwd=pwdinput;
    $.ajax({
        type: "post",
        url: "php/signin.php",
        data: {"name":id,"pwd":pwd},
        dataType: "text",
        success: function (msg) {
            alert(msg);
        }
    });
}

function check(nameinput,pwdinput,val){
    var id=nameinput;
    var pwd=pwdinput;
    var value=val;
    $.ajax({
        type: "post",
        url: "php/signup.php",
        data: {"name":id,"pwd":pwd,"val":value},
        dataType: "json",
        success: function (msg) {
            var accountinfo=msg.jsonobj;
            if(accountinfo.errorinfo){
                alert(accountinfo.errorinfo);
            }
            else{
                if(accountinfo.student){
                    alert("登陆成功！欢迎你,学生"+accountinfo.name+"！");
                    window.location.href="student.html";
                }
                if(accountinfo.teacher){
                    alert("登陆成功！欢迎你,教师"+accountinfo.name+"！");
                    window.location.href="teacher.html";
                }
                if(accountinfo.admin){
                    alert("登陆成功！欢迎你,管理员"+accountinfo.name+"！");
                    window.location.href="manager.html";
                }
            }
        }
    });
}